package cn.sc.allinpay.allfavour.business.cashiertrsdetailonline;

import android.os.Bundle;
import android.support.v7.widget.AppCompatButton;
import android.support.v7.widget.AppCompatTextView;
import android.view.View;
import android.widget.RelativeLayout;


import butterknife.BindView;
import butterknife.OnClick;
import cn.sc.allinpay.allfavour.R;
import cn.sc.allinpay.allfavour.base.activity.BaseActivity;


/**
 * activity 交易详情
 * author：pany
 * on 2017/12/1 11:14
 */
public class CashierTransDetailOnlineActivity extends BaseActivity<CashierTransDetailOnlineContract.View, CashierTransDetailOnlineContract.Presenter>
        implements CashierTransDetailOnlineContract.View {

    @BindView(R.id.llDetail)
    RelativeLayout llDetail;//折扣视图

    @BindView(R.id.tvOrderId)
    AppCompatTextView tvOrderId;
    @BindView(R.id.tvTransTime)
    AppCompatTextView tvTransTime;
    @BindView(R.id.tvCashierName)
    AppCompatTextView tvCashierName;
    @BindView(R.id.tvGuideName)
    AppCompatTextView tvGuideName;
    @BindView(R.id.tvTransAmt)
    AppCompatTextView tvTransAmt;
    @BindView(R.id.btnPrint)
    AppCompatButton btnPrint;

    @BindView(R.id.llDiscount)
    RelativeLayout llDiscount;//折扣视图
    @BindView(R.id.tvDisState)
    AppCompatTextView tvDisState;
    @BindView(R.id.tvMemberNo)
    AppCompatTextView tvMemberNo;
    @BindView(R.id.tvDiscount)
    AppCompatTextView tvDiscount;
    @BindView(R.id.tvCoupons)
    AppCompatTextView tvCoupons;
    @BindView(R.id.tvEWalletAmt)
    AppCompatTextView tvEWalletAmt;


    @BindView(R.id.llPos)
    RelativeLayout llPos;//pos消费视图

    @BindView(R.id.tvPosAmt)
    AppCompatTextView tvPosAmt;

    @Override
    protected int layoutId() {
        return R.layout.activity_cashier_trans_detail_online;
    }

    @Override
    protected void layoutTitle(View top, AppCompatTextView left, AppCompatTextView title, AppCompatTextView right) {
        title.setText("详情");
    }

    @Override
    protected CashierTransDetailOnlineContract.Presenter bindPresenter() {
        return new CashierTransDetailOnlinePresenter();
    }

    @Override
    protected void layoutContent(Bundle savedInstanceState) {

    }

    @Override
    public void showOrderId(String data) {
        tvOrderId.setText("订  单  号:      " + data);
    }

    @Override
    public void showTransTime(String data) {
        tvTransTime.setText("交易时间:      " + data);
    }

    @Override
    public void showCashierName(String data) {
        tvCashierName.setText("油  品  号:      " + data);
    }

    @Override
    public void showGuideName(String data) {
        tvGuideName.setText("车  牌  号:      " + data);
    }

    @Override
    public void showDetailView(int visible) {
        llDetail.setVisibility(visible);
    }

    @Override
    public void showPosAmt(String data) {
        tvPosAmt.setText("支        付:      " + data);
    }

    @Override
    public void showTransAmt(String data) {
        tvTransAmt.setText("订单金额:      " + data);
    }

    @Override
    public void showDisState(String data) {
        tvDisState.setText("状        态:      " + data);
    }

    @Override
    public void showMemberNo(String data) {
        tvMemberNo.setText("会员卡号:      " + data);
    }

    @Override
    public void showDiscount(String data) {
        tvDiscount.setText("会员优惠:      " + data);
    }

    @Override
    public void showCoupons(String data) {
        tvCoupons.setText("卡        券:      " + data);
    }

    @Override
    public void showEWalletAmt(String data) {
        tvEWalletAmt.setText("电子钱包:      " + data);
    }

    @OnClick({R.id.btnPrint})
    public void btnClick(View view) {
        switch (view.getId()) {
            case R.id.btnPrint:
                presenter.callPrint();//重打印
                break;
        }
    }
}
